/*
============================================================================
 Name        : C$(Basename) from $(Basename).h
 Author      : $(Author)
 Version     :
 Copyright   : $(Copyright)
 Description : C$(Basename) DLL source
============================================================================
*/

//  Include Files  

#include "$(Basename).h"	// C$(Basename)
#include "$(Basename).pan"      	// panic codes


//  Member Functions

EXPORT_C C$(Basename)* C$(Basename)::NewLC()
	{
	C$(Basename)* self = new (ELeave) C$(Basename);
	CleanupStack::PushL(self);
	self->ConstructL();
	return self;
	}


EXPORT_C C$(Basename)* C$(Basename)::NewL()
	{
	C$(Basename)* self = C$(Basename)::NewLC();
	CleanupStack::Pop(self);
	return self;
	}


C$(Basename)::C$(Basename)()
// note, CBase initialises all member variables to zero
	{
	}


void C$(Basename)::ConstructL()
	{
	// second phase constructor, anything that may leave must be constructed here
	iString = new (ELeave) T$(Basename)ExampleString;
	}


EXPORT_C C$(Basename)::~C$(Basename)()
	{
	delete iString;
	}


EXPORT_C TVersion C$(Basename)::Version() const
	{
	// Version number of example API
	const TInt KMajor = 1;
	const TInt KMinor = 0;
	const TInt KBuild = 1;
	return TVersion(KMajor, KMinor, KBuild);
	}


EXPORT_C void C$(Basename)::ExampleFuncAddCharL(const TChar& aChar)
	{
	//__ASSERT_ALWAYS(iString != NULL, Panic(E$(Basename)NullPointer));

	if (iString->Length() >= K$(Basename)BufferLength)
		{
		User::Leave(KErrTooBig);
		}

	iString->Append(aChar);
	}


EXPORT_C void C$(Basename)::ExampleFuncRemoveLast()
	{
	//__ASSERT_ALWAYS(iString != NULL, Panic(E$(Basename)NullPointer));

	if (iString->Length() > 0)
		{
		iString->SetLength(iString->Length() - 1);
		}
	}


EXPORT_C const TPtrC C$(Basename)::ExampleFuncString() const
	{
	//__ASSERT_ALWAYS(iString != NULL, Panic(E$(Basename)NullPointer));
	return *iString;
	}
